home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / metasploit / src / passivex / CPassiveX.h < prev    next >
C/C++ Source or Header  |  2006-06-30  |  3KB  |  115 lines

  1. /*
  2.  * This file is part of the Metasploit Exploit Framework
  3.  * and is subject to the same licenses and copyrights as
  4.  * the rest of this package.
  5.  */
  6. #ifndef _CPASSIVEX_H
  7. #define _CPASSIVEX_H
  8.  
  9. #include <windows.h>
  10. #include <atlbase.h>
  11.  
  12. extern CComModule _Module;
  13.  
  14. #include <atlcom.h>
  15. #include <ocidl.h>
  16.  
  17. #include "HttpTunnel.h"
  18.  
  19. class ATL_NO_VTABLE CPassiveX : 
  20.     public CComObjectRootEx<CComMultiThreadModel>,
  21.     public CComCoClass<CPassiveX, &CLSID_PassiveX>,
  22.     public CComControl<CPassiveX>,
  23.     public IOleObjectImpl<CPassiveX>,
  24.     public IOleControlImpl<CPassiveX>,
  25.     public IOleInPlaceActiveObjectImpl<CPassiveX>,
  26.     public IOleInPlaceObjectWindowlessImpl<CPassiveX>,
  27.     public IObjectWithSiteImpl<CPassiveX>,
  28.     public IProvideClassInfo2Impl<&CLSID_PassiveX, &DIID_PassiveXEvents, &LIBID_PassiveXCOM>,
  29.     public IConnectionPointContainerImpl<CPassiveX>,
  30.     public IDispatchImpl<IPassiveX, &IID_IPassiveX, &LIBID_PassiveXCOM>,
  31.     public IConnectionPointImpl<CPassiveX, &DIID_PassiveXEvents, CComDynamicUnkArray>,
  32.     public IPersistPropertyBagImpl<CPassiveX>,
  33.     public ISupportErrorInfo
  34. { public:
  35.         CPassiveX();
  36.         ~CPassiveX();
  37.  
  38.         DECLARE_REGISTRY_RESOURCEID(IDR_PASSIVEX)
  39.         DECLARE_PROTECT_FINAL_CONSTRUCT()
  40.         BEGIN_COM_MAP(CPassiveX)
  41.             COM_INTERFACE_ENTRY(IPassiveX)
  42.             COM_INTERFACE_ENTRY(IDispatch)
  43.             COM_INTERFACE_ENTRY(ISupportErrorInfo)
  44.             COM_INTERFACE_ENTRY(IProvideClassInfo)
  45.             COM_INTERFACE_ENTRY(IProvideClassInfo2)
  46.             COM_INTERFACE_ENTRY(IObjectWithSite)
  47.             COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
  48.             COM_INTERFACE_ENTRY(IOleInPlaceObject)
  49.             COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObject)
  50.             COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
  51.             COM_INTERFACE_ENTRY(IOleControl)
  52.             COM_INTERFACE_ENTRY(IOleObject)
  53.             COM_INTERFACE_ENTRY(IPersistPropertyBag)
  54.             COM_INTERFACE_ENTRY(IConnectionPointContainer)
  55.             COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  56.         END_COM_MAP()
  57.  
  58.         // We are a singleton
  59.         DECLARE_CLASSFACTORY_SINGLETON(CPassiveX);
  60.  
  61.         // Messages
  62.         BEGIN_MSG_MAP(CPassiveX)
  63.             CHAIN_MSG_MAP(CComControl<CPassiveX>)
  64.             DEFAULT_REFLECTION_HANDLER()
  65.         END_MSG_MAP()
  66.  
  67.         // Connections
  68.         BEGIN_CONNECTION_POINT_MAP(CPassiveX)
  69.             CONNECTION_POINT_ENTRY(DIID_PassiveXEvents)
  70.         END_CONNECTION_POINT_MAP()
  71.  
  72.         // Properties
  73.         BEGIN_PROPERTY_MAP(CPassiveX)
  74.             PROP_ENTRY("HttpHost", PASSIVEX_PROPERTY_HTTP_HOST, CLSID_NULL)
  75.             PROP_ENTRY("HttpPort", PASSIVEX_PROPERTY_HTTP_PORT, CLSID_NULL)
  76.             PROP_ENTRY("DownloadSecondStage", PASSIVEX_PROPERTY_DOWNLOAD_SECOND_STAGE, CLSID_NULL)
  77.         END_PROPERTY_MAP()
  78.  
  79.         // ISupportErrorInfo
  80.         STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  81.  
  82.         // IPassiveX
  83.         STDMETHOD(get_HttpHost)(BSTR *Host);
  84.         STDMETHOD(put_HttpHost)(BSTR Host);
  85.         STDMETHOD(get_HttpPort)(ULONG *Port);
  86.         STDMETHOD(put_HttpPort)(ULONG Port);
  87.         STDMETHOD(get_DownloadSecondStage)(ULONG *Port);
  88.         STDMETHOD(put_DownloadSecondStage)(ULONG Port);
  89.  
  90. #ifdef PXDEBUG
  91.         // Debug logging
  92.         static VOID Log(LPCTSTR fmt, ...);
  93. #else
  94.         static VOID Log(LPCTSTR fmt, ...) { }
  95. #endif
  96.     protected:
  97.  
  98.         VOID Initialize();
  99.  
  100.         VOID ResetExplorerZoneRestrictions();
  101.  
  102.         /**************
  103.          * Attributes *
  104.          **************/
  105.  
  106.         // Properties
  107.         CComBSTR   PropHttpHost;
  108.         ULONG      PropHttpPort;
  109.  
  110.         // Tunnel
  111.         HttpTunnel Tunnel;
  112. };
  113.  
  114. #endif
  115.